<!doctype html>
<html lang="en">

<head>
    {{template "header" .}}
</head>

<body>
    <div class="wrapper">
        {{template "adminSidebar" .}}
        <div class="main-panel">
            {{template "nav" .}}
            <div class="content bg-white">
                <div class="container">
                    {{if .isPostReq}}
                        {{if .titleExist}}
                        <div class="alert alert-warning" style="background-color:#CFCFCF;border-radius: 20px;">
                            <a href="#" class="close" data-dismiss="alert">
                                &times;
                            </a>
                            <strong>提示！</strong>添加成功。
                        </div>
                        {{else}}
                        <div class="alert alert-warning" style="background-color:#CFCFCF;border-radius: 20px;">
                            <a href="#" class="close" data-dismiss="alert">
                                &times;
                            </a>
                            <strong>警告！</strong>名称不能为空。
                        </div>
                        {{end}}
                    {{end}}
                    <h3 style="text-align:center;">分类标签添加</h3>
                    <hr>
                    <form method="POST" action="/admin/category/add" class="form-horizontal" role="form">
                        <div class="col-xs-1 col-sm-1 col-md-1"></div>
                        <button type="submit" style="border-radius: 0px;height:40px;" class="col-xs-4 col-sm-4 col-md-4 btn btn-default ">添 加 分 类</button>
                        <div class="col-xs-2 col-sm-2 col-md-2"></div>
                        <div class="col-xs-4 col-sm-4 col-md-4 input-group">
                            <input id="categoryName" name="category_name" type="text" class="form-control" placeholder="分类名称" style="border:2px solid #66615b;">
                        </div>
                        <div class="col-xs-1 col-sm-1 col-md-1"></div>
                    </form>
                    <div class="col-xs-12 col-sm-12 col-md-12"></div>
                    <form method="POST" action="/admin/tag/add" class="form-horizontal" role="form">
                        <div class="col-xs-1 col-sm-1 col-md-1"></div>
                        <button type="submit" style="border-radius: 0px;height:40px;" class="col-xs-4 col-sm-4 col-md-4 btn btn-default ">添 加 标 签</button>
                        <div class="col-xs-2 col-sm-2 col-md-2"></div>
                        <div class="col-xs-4 col-sm-4 col-md-4 input-group">
                            <input id="tagName" name="tag_name" type="text" class="form-control" placeholder="标签名称" style="border:2px solid #66615b;">
                        </div>
                        <div class="col-xs-1 col-sm-1 col-md-1"></div>
                    </form>
                    <hr>
                    <h3 style="text-align:center;">文章管理</h3>
                    <hr>
                    <table class="table">
                        <thead>
                            <tr>
                            <th>Title</th>
                            <th>Edit</th>
                            <th>Delete</th>
                            </tr>
                        </thead>
                        <tbody>
                            {{range .articles}}
                            <tr>
                            <td>{{.Title}}</td>
                            <td><a href="/article/{{.ID}}/edit">编辑</a></td>
                            <td><a href="/article/{{.ID}}/del">删除</a></td>
                            </tr>
                            {{end}}
                        </tbody>
                    </table>
                </div>
            </div>
            {{template "footer" .}}
        </div>
    </div>
    </div>
    <!--   Core JS Files   -->
    <script src="/assets/js/jquery-1.10.2.js" type="text/javascript"></script>
    <script src="/assets/js/bootstrap.min.js" type="text/javascript"></script>
    <!-- Paper Dashboard Core javascript and methods for Demo purpose -->
    <script src="/assets/js/goodman.js"></script>
</body>

</html>